Option Explicit
Sub F_Sample020()
    'Microsoft ActiveX Data Objects 2.X Library ]wޥζ
    'ոF_Data.mdb F_Tbl01
    Dim myCon      As New ADODB.Connection
    Dim myRst      As New ADODB.Recordset
    Dim myFileName As String
    Dim myTblName  As String
    Dim myKey      As String
    Dim i          As Long
    Worksheets.Add
    myFileName = "F_Data.mdb"			'ŪJɮ
    myTblName = "F_Tbl01"        		'ŪJ
    myCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=" & ThisWorkbook.Path & "\" & myFileName & ";"
    ']wT{ί    'Aܧ
    With myRst
        .Index = "PrimaryKey"
        '}Ҹƿ
        myRst.Open Source:=myTblName, ActiveConnection:=myCon, _
        CursorType:=adOpenKeyset, LockType:=adLockOptimistic, _
        Options:=adCmdTableDirect
        'JjMKEY
        myKey = InputBox("пJjMKEY-s:")
        'jMO_sn
        .Seek myKey
        'nɪBz
        If .EOF Then
            MsgBox ("ӽsSQn")
        Else
            'ܳBz
            'W
            For i = 1 To .Fields.Count
                Cells(1, i).Value = .Fields(i - 1).Name
            Next
            Range("A2").CopyFromRecordset myRst, 1
        End If
        .Close
    End With
    myCon.Close
    Set myRst = Nothing					'
    Set myCon = Nothing
End